﻿using AutoMapper;
using WMS.API.Application.Command.BasicManagement.ProductManage;
using WMS.API.Application.Command.BasicManagement.ShelfManage;
using WMS.API.Application.Command.InventoryManagement;
using WMS.API.Application.Command.StocktakingManagement;
using WMS.API.Application.Command.StocktakingManagement.PendingOrder;
using WMS.API.Application.CommandHandlers.BasicManagement.ShelfManage;
using WMS.Domain.Entities.BasicManagement;
using WMS.Domain.Entities.InventoryManagement;
using WMS.Domain.Entities.StocktakingManagement;
using WMS.Domain.Entities.SystemUser;

namespace WMS.API.Write
{
    /// <summary>
    /// 映射类
    /// </summary>
    public class MyMapper : Profile
    {
        /// <summary>
        /// 构造函数：初始化映射配置
        /// </summary>
        public MyMapper()
        {
            // 添加 RechargeUserCommand 到 RechargeUser 的映射
            CreateMap<RechargeUserCommand, RechargeUser>().ReverseMap();

            //库存管理-添加箱子型号命令映射-grx
            CreateMap<AddboxCommand, BoxManagement>().ReverseMap();
            //库存管理-修改箱子型号命令映射-grx
            CreateMap<UpdateBoxCommand, BoxManagement>().ReverseMap();
            //库存管理-添加库存出入库映射-grx
            CreateMap<AddInandoutofStorageCommand, InandoutofStorage>().ReverseMap();


            // 如果实体属性名称与命令类属性名称不完全匹配，需要显式指定映射
            // 例如:
            // CreateMap<RechargeUserCommand, RechargeUser>()
            //    .ForMember(dest => dest.UserCode, opt => opt.MapFrom(src => src.UserCode));

            //产品管理添加
            CreateMap<AddProductManageCommand, ProductManageModel>().ReverseMap();
            //产品管理修改
            CreateMap<UpdateProductManageCommand, ProductManageModel>().ReverseMap();
            CreateMap<AddPendingOrdersCommand, PendingOrders>().ReverseMap();
            CreateMap<UpdatePendingOrdersCommand, PendingOrders>().ReverseMap();
            //货架
            CreateMap<ShelfManageModel, AddShelfManageModelCommand>().ReverseMap();
            CreateMap<ShelfManageModel, UpdShelfManageModelCommand>().ReverseMap();
        }
    }
}
